package online.shenme.day17;

import online.shenme.day17.enumtest.EnumTest;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public class Annotest {
    public static void main(String[] args) throws InstantiationException, IllegalAccessException, InvocationTargetException {
        Class<EnumTest> aClass = EnumTest.class;
        EnumTest instance = aClass.newInstance();
        for (Method method : aClass.getDeclaredMethods()) {
            if (method.isAnnotationPresent(AnnotationTest.class)){
                method.setAccessible(true);
                method.invoke(instance);
            }
        }
    }
}
